<template>
  <div id="officialTopSearch">
    <div class="search-box">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="创建时间">
          <el-date-picker
            v-model="formInline.date"
            type="datetimerange"
            range-separator="至"
            start-placeholder="2019-03-14 24:00"
            end-placeholder="2019-08-14 12:00"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="审核状态">
          <el-select v-model="formInline.firstStatus" placeholder="请选择">
            <el-option
              v-for="item in firstStatusList"
              :key="item.key"
              :label="item.key"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="提交状态">
          <el-select v-model="formInline.secondStatus" placeholder="请选择">
            <el-option
              v-for="item in secondStatusList"
              :key="item.key"
              :label="item.key"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- 编号部分 -->
        <el-form-item>
          <el-input v-model="inputValue" placeholder="请输入">
            <el-select
              slot="prepend"
              v-model="formInline.activeNumber"
              placeholder="ID"
            >
              <el-option
                v-for="item in activeNumberList"
                :key="item.key"
                :label="item.key"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-input>
        </el-form-item>
        <el-form-item class="s-btn">
          <el-button
            type="success"
            icon="el-icon-search"
            @click="toSearch"
          >
            查询
          </el-button>
          <el-button type="success" plain @click="reset">
            重置
          </el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  name: 'officialTopSearch',
  msg: '问卷调查活动管理-顶部搜索',
  props: {
    formInline: {
      type: Object,
      default: function() {
        return {
          firstStatus: 0, // 审核状态,默认全部
          secondStatus: 0, // 提交状态,默认全部
          activeNumber: 0, // 活动编号
          date: '' // 选择的时间
        }
      }
    }
  },
  data() {
    return {
      // 审核状态列表
      firstStatusList: [
        { key: '全部', value: 0 },
        { key: '未审核', value: 1 },
        { key: '已通过', value: 2 },
        { key: '未通过', value: -1 }
      ],
      // 提交状态列表
      secondStatusList: [
        { key: '全部', value: 0 },
        { key: '未审核', value: 1 },
        { key: '已通过', value: 2 },
        { key: '未通过', value: -1 }
      ],
      // ID编号列表
      activeNumberList: [
        { key: 'ID', value: 0 },
        { key: 'HD001', value: 1 },
        { key: 'HD002', value: 2 }
      ],
      inputValue: '' // 搜索框内容
    }
  },
  mounted() {},
  methods: {
    /* 搜索 */
    toSearch() {},
    /* 重置 */
    reset() {}
  }
}
</script>

<style lang="less">
#officialTopSearch {
  .search-box {
    padding-left: 30px !important;
  }
  .activeType {
    width: 90px;
  }
}
</style>
